﻿<Window x:Class="KTool2.TestWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Hiragana Test" Height="345" Width="300"
        FontFamily='Lucida Sans Unicode'
        ResizeMode="NoResize"
        DataContext="{Binding RelativeSource={RelativeSource Self}}" 
        Icon="/KTool 2;component/Images/Rate.png">
    <DockPanel>
        <Menu IsMainMenu="True" 
              DockPanel.Dock="Top" 
              Height="23">
            <MenuItem Name="mnuiJPNCategories"
                      Header="_Categories">
            </MenuItem>
            
            <MenuItem Name="mnuiMemrate"
                      Header="_Memrate"
                      IsChecked="False"
                      IsCheckable="False">
                <MenuItem.Resources>
                    <Style TargetType="Image">
                        <Setter Property="Height" Value="20"></Setter>
                        <Setter Property="Width" Value="20"></Setter>
                    </Style>
                    <Style TargetType="MenuItem">
                        <!--<Setter Property="IsChecked" Value="True"></Setter>-->
                        <Setter Property="IsCheckable" Value="True"></Setter>
                        <EventSetter Event="Click" Handler="mnui_Click"></EventSetter>
                    </Style>
                </MenuItem.Resources>
                <MenuItem Name="mnuiMrt1">
                    <MenuItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/KTool 2;component/Images/Rate.png"></Image>
                        </StackPanel>
                    </MenuItem.Header>
                </MenuItem>
                <MenuItem Name="mnuiMrt2">
                    <MenuItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/KTool 2;component/Images/Rate.png"></Image>
                            <Image Source="/KTool 2;component/Images/Rate.png"></Image>
                        </StackPanel>
                    </MenuItem.Header>
                </MenuItem>
                <MenuItem Name="mnuiMrt3">
                    <MenuItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/KTool 2;component/Images/Rate.png"></Image>
                            <Image Source="/KTool 2;component/Images/Rate.png"></Image>
                            <Image Source="/KTool 2;component/Images/Rate.png"></Image>
                        </StackPanel>
                    </MenuItem.Header>
                </MenuItem>
                <MenuItem Name="mnuiMrt4">
                    <MenuItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/KTool 2;component/Images/Rate.png"></Image>
                            <Image Source="/KTool 2;component/Images/Rate.png"></Image>
                            <Image Source="/KTool 2;component/Images/Rate.png"></Image>
                            <Image Source="/KTool 2;component/Images/Rate.png"></Image>
                        </StackPanel>
                    </MenuItem.Header>
                </MenuItem>
                <MenuItem Name="mnuiMrt5">
                    <MenuItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/KTool 2;component/Images/Rate.png"></Image>
                            <Image Source="/KTool 2;component/Images/Rate.png"></Image>
                            <Image Source="/KTool 2;component/Images/Rate.png"></Image>
                            <Image Source="/KTool 2;component/Images/Rate.png"></Image>
                            <Image Source="/KTool 2;component/Images/Rate.png"></Image>
                        </StackPanel>
                    </MenuItem.Header>
                </MenuItem>
                <Separator></Separator>
                <MenuItem Name="mnuiMrtAll"
                          Header="All Memrate"
                          IsChecked="True">
                </MenuItem>
            </MenuItem>
            
            <MenuItem Name="mnuiFairRandom"
                      Header="_Fair Random"
                      IsCheckable="True"
                      ToolTipService.ShowDuration="60000"
                      ToolTipService.HasDropShadow="True"
                      ToolTipService.BetweenShowDelay ="1">
                <MenuItem.ToolTip>
                    <StackPanel>
                        <Label FontWeight="Bold" 
                               Background="#3652a4" 
                               Foreground="White">
                            <StackPanel Orientation="Horizontal">
                                <Image Source="/KTool 2;component/Images/Rate.png"
                                       Height="22"
                                       Width="22">
                                </Image>
                                <TextBlock Foreground="White"
                                           Margin="3"
                                           VerticalAlignment="Center">
                                    Fair Random
                                </TextBlock>
                            </StackPanel>
                        </Label>
                        <TextBlock Padding="10"
                                   TextWrapping="WrapWithOverflow"
                                   Width="200">
                            If this menu is not checked, the words that 
                            have low memrate have more chance to appear
                            than the higher memrate ones
                        </TextBlock>
                        <Line Stroke="Black" StrokeThickness="1" X2="200"></Line>
                        <TextBlock Padding="10"
                                   TextWrapping="WrapWithOverflow"
                                   Width="200">
                            If this menu is checked, the next word 
                            is fairly randomly got from database regardless 
                            to the memrate.
                        </TextBlock>
                    </StackPanel>
                </MenuItem.ToolTip>
            </MenuItem>
        </Menu>
        
        <StatusBar DockPanel.Dock="Bottom"
                   Height="23">
            <StatusBar.ItemsPanel>
                <ItemsPanelTemplate>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="2*"></ColumnDefinition>
                            <ColumnDefinition Width="*"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                    </Grid>
                </ItemsPanelTemplate>
            </StatusBar.ItemsPanel>
            
            <StatusBarItem>
                <TextBlock Name="txtAccuracy">
                    Accuracy:
                </TextBlock>
            </StatusBarItem>
            
            <StatusBarItem Grid.Column="1">
                <TextBlock Name="txtTotal">
                    Total:
                </TextBlock>
            </StatusBarItem>
            
        </StatusBar>
        
        <StackPanel>
            <StackPanel Orientation="Horizontal"
                        HorizontalAlignment="Center"
                        Height="40">
                <StackPanel.Resources>
                    <Style TargetType="Image">
                        <Setter Property="Height" 
                                Value="22">
                        </Setter>
                        <Setter Property="Width" 
                                Value="22">
                        </Setter>
                        <Setter Property="Margin"
                                Value="5, 10, 5, 5">
                        </Setter>
                        <!--<Setter Property="Source"
                                Value="/KTool 2;component/Images/Rate.png">
                        </Setter>-->
                        <EventSetter Event="MouseDown"
                                     Handler="rate_MouseDown">
                        </EventSetter>
                    </Style>
                </StackPanel.Resources>
                <Image Name="rate1" 
                       Source="/KTool 2;component/Images/Rate.png">
                </Image>
                <Image Name="rate2"
                       Source="/KTool 2;component/Images/Rate.png">
                </Image>
                <Image Name="rate3"
                       Source="/KTool 2;component/Images/Rate.png">
                </Image>
                <Image Name="rate4"
                       Source="/KTool 2;component/Images/Rate.png">
                </Image>
                <Image Name="rate5"
                       Source="/KTool 2;component/Images/Rate.png">
                </Image>
            </StackPanel>

            <TextBox Name="txtKanji"
                     BorderThickness="0"
                     HorizontalAlignment="Center"
                     IsReadOnly="True"
                     FontSize="24"
                     FontWeight="Bold"
                     VerticalAlignment="Center"
                     ToolTipService.ShowDuration="60000"
                     ToolTipService.HasDropShadow="True"
                     ToolTipService.InitialShowDelay="0">
                <TextBox.ToolTip>
                    <StackPanel>
                        <Label Name="lbltltpHiragana"
                               HorizontalAlignment="Center">
                            ???
                        </Label>
                        <Line Stroke="Black" StrokeThickness="1" X2="200"></Line>
                        <Label Name="lbltltpHanNom"
                               HorizontalAlignment="Center">
                            ???
                        </Label>
                        <Line Stroke="Black" StrokeThickness="1" X2="200"></Line>
                        <Label Name="lbltltpEnglish"
                               HorizontalAlignment="Center">
                            ???
                        </Label>
                        <Line Stroke="Black" StrokeThickness="1" X2="200"></Line>
                        <Label Name="lbltltpMeaning"
                               HorizontalAlignment="Center">
                            ???
                        </Label>
                    </StackPanel>
                </TextBox.ToolTip>
                開始
            </TextBox>

            <Grid Height="28" Margin="5">
                <TextBox Name="txtAnswerHiragana"
                         BorderThickness="0"
                         HorizontalAlignment="Center"
                         IsReadOnly="True"
                         FontSize="15"
                         FontWeight="Bold"
                         VerticalAlignment="Center">
                    かいし
                </TextBox>
                <Button Name="btnShowAnswer"
                        Padding="3"
                        Width="40"
                        Click="btn_Click">
                    ?
                </Button>
            </Grid>

            <ProgressBar Name="prgrsEvaluation"
                     Height="24"
                     Margin="20, 0, 20, 5"
                     Value="0">
            </ProgressBar>

            <Button Name="btnNext"
                Padding="3"
                Width="100"
                Margin="5"
                Click="btn_Click">
                Next
            </Button>

            <Grid Margin="10, 5, 10, 5">
                <!--<TextBox Name="txtBackground"
                         GotFocus="txtBackground_GotFocus"
                         GotKeyboardFocus="txtBackground_GotKeyboardFocus"
                         IsReadOnly="True">
                </TextBox>-->
                <Rectangle Height="25"
                           Stroke="Black"
                           Cursor="IBeam"
                           Fill="White"
                           MouseDown="Rectangle_MouseDown">
                </Rectangle>

                <TextBox Name="txtHiragana"
                     HorizontalAlignment="Center"
                     VerticalAlignment="Center"
                     BorderThickness="0"
                     Background="Transparent">
                    かいし
                </TextBox>
            </Grid>

            <Button Name="btnOK"
                Padding="3"
                Width="100"
                Margin="5"
                IsDefault="True" 
                Click="btn_Click">
                OK
            </Button>
        </StackPanel>
    </DockPanel>
</Window>
